import { getPrcodeList } from '@/api/property/qrcode.js'
import { getWarehouseList } from '@/api/property/manage.js'
import { getUnitListAll } from '@/api/property/unit.js'
import { getPersonListAll } from '@/api/property/person.js'
// 梁聖妙

// 请求处理二维码编号
export const qrCodeDispose = async () => {
  let add = []
  await getPrcodeList().then(e => {
    e.data.forEach(res => {
      add.push({ label: res.serialNum, value: res.id })
    })
  })
  return add
}

// 处理仓库列表数据
export const warehouseDispose = async () => {
  let add = []
  await getWarehouseList().then(e => {
    e.rows.forEach(res => {
      add.push({ label: res.name, value: res.id })
    })
  })
  return add
}

// 处理办案单位数据
export const unitDispose = async () => {
  let add = []
  await getUnitListAll().then(e => {
    e.data.forEach(res => {
      add.push({ label: res.name, value: res.id })
    })
  })
  return add
}

// 处理办案人员数据
export const personnelDispose = async () => {
  let add = []
  await getPersonListAll().then(e => {
    e.data.forEach(res => {
      add.push({ label: res.name, value: res.huId })
    })
  })
  return add
}
